export class JSS {

    static mix(...args) {

        if (args.length == 1) return args[0]
        let target = args[0]

        for (let i = 1; i < args.length; i++) {

            let obj = args[i]
            if (typeof (obj) != 'object') continue

            for (let p in obj) {
                target[p] = obj[p]
            }
        }

        return target
    }

    static url_mix(url, data) {

        let url_has_params = (url.indexOf('?') > -1)

        for (let param in data) {

            url += url_has_params ? '&' : '?'
            url += `${param}=${data[param]}`

            url_has_params = true
        }

        return url
    }
}